package cn.gson.boot.model.dao;

import cn.gson.boot.model.pojos.PurchaseReturn;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import javax.transaction.Transactional;

public interface PurchaseReturnDao extends CrudRepository<PurchaseReturn,Integer> {
    // 修改采购退货单的审核状态
    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(nativeQuery = true,value = "update purchase_return set pur_return_status=?1 where pur_return_id=?2")
    public void shenhePurchaseReturn(String zt,Integer purReturnId);

    // 修改采购退货单的出库状态
    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(nativeQuery = true,value = "update purchase_return set pur_return_ck=?1 where pur_return_id=?2")
    public void updatePurchaseReturnChuKu(String ckzt,Integer purReturnId);
}
